<?php
declare (strict_types = 1);

namespace app\command;

use think\console\Command;
use think\console\Input;
use think\console\input\Argument;
use think\console\input\Option;
use think\console\Output;
use think\Db;

class Test extends Command
{
    protected function configure()
    {
        // 指令配置
        $this->setName('test')
            ->setDescription('the test command');
    }

    protected function execute(Input $input, Output $output)
    {

        $time = explode ( " ", microtime () );
        $time = $time[1] . ($time[0] * 1000);
        $time2 = explode( ".", $time );
        $time = $time2[0];
        echo $time;die;
        echo 111111;die;

        $data = [
            [
                "sys_type" => 5,
                "sys_name" => "体验版",
                "create_time" => time(),
                "update_time" => time(),
            ],
            [
                "sys_type" => 5,
                "sys_name" => "初级版",
                "create_time" => time(),
                "update_time" => time(),
            ],
            [
                "sys_type" => 5,
                "sys_name" => "中级版",
                "create_time" => time(),
                "update_time" => time(),
            ],
            [
                "sys_type" => 5,
                "sys_name" => "高级版",
                "create_time" => time(),
                "update_time" => time(),
            ],
        ];
        Db::name("sys_config") -> insertAll($data);

        // 指令输出
        $output->writeln('test');
    }
}
